-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Changes made in configuration.py to accept environmental variables #2390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What type of PR is this? /kind bug What this PR does / why we need it: This PRs will read environment variables assigned for proxy and no_proxy.
Update configuration.py What type of PR is this? /kind bug What this PR does / why we need it: This PRs will read environment variables assigned for proxy and no_proxy.
/assign |
if(os.getenv("HTTPS_PROXY")):self.proxy=os.getenv("HTTPS_PROXY") | ||
if(os.getenv("https_proxy")):self.proxy=os.getenv("https_proxy") | ||
if(os.getenv("HTTP_PROXY")):self.proxy=os.getenv("HTTP_PROXY") | ||
if(os.getenv("http_proxy")):self.proxy=os.getenv("http_proxy") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is generated by the upstream openapi generator. Could you make the change upstream?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have checked https://github.com/OpenAPITools/openapi-generator. We need to change in https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/python/configuration.mustache (as it is python code change.). But while I am at it. I observed that there is no no_proxy variable there.
I am not sure whether I can add no_proxy variable to it or not. It was removed for some reasons according to this issue OpenAPITools/openapi-generator#20226.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is only for self.proxy=None. I can add it to https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/python/configuration.mustache.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I observed that there is no no_proxy variable there.
This client is based on an old version of the upstream generator. The upstream generator probably had some change to the no_proxy variable since then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of upstreaming the changes can we downstream the changes to files that using configuration.py variables. i.e. python_kubernetes\kubernetes\base\stream\ws_client.py and python_kubernetes\kubernetes\client\rest.py. We can add this change in above files. But I have a doubt will it impact this changes if we use Open-api generator...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was in my commits and I am unable to delete it...
Oh sorry missed that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm not sure. From the title "Merge branch 'kubernetes-client:master' into master" it sounds like it was trying to merge the upstream master into your master branch.
An alternative is to open a new PR with a fresh branch, if you cannot delete this commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roycaihw , I added scripts/insert_proxy_config.sh. This will edit configuration.py file local. So, even if we re-generate file from openapi-generator it will edit it. I added it in release.sh. It will ensure that scripts/insert_proxy_config.sh is executed when release.sh is ran...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm not sure. From the title "Merge branch 'kubernetes-client:master' into master" it sounds like it was trying to merge the upstream master into your master branch.
An alternative is to open a new PR with a fresh branch, if you cannot delete this commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roycaihw Can you check and approve my PR
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: p172913 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PRs will read environment variables assigned for proxy and no_proxy.
Which issue(s) this PR fixes:
Fixes #2321
Special notes for your reviewer:
Unit test is added kubernetes\base\stream\ws_client_test.py
Does this PR introduce a user-facing change?
None
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
None